package com.guigu.guliorder.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.guigu.gulicommon.constant.enumes.order.MqMsgStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * MQ消息
 * </p>
 *
 * @author 陈俊杰
 * @since 2024-08-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("mq_message")
public class MqMessage implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 消息id
     */
    @TableId(value = "message_id", type = IdType.ASSIGN_UUID)
    private String messageId;
    /**
     * 消息内容
     */
    private String content;
    /**
     * 消息队列
     */
    private String toExchane;
    /**
     * 路由键
     */
    private String routingKey;
    /**
     * 消息类型
     */
    private String classType;

    /**
     * 0-新建 1-已发送 2-错误抵达 3-已抵达
     */
    private MqMsgStatus messageStatus;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    /**
     * 修改时间
     */
    @OrderBy(sort = 10)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}
